﻿




<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>AddUser</title>

    <link href="~/Style/layui/css/layui.css" rel="stylesheet" />
</head>
<body>
    

        <div class="layui-form-item">
            <label class="layui-form-label">用户编号</label>
            <div class="layui-input-inline">
                <input type="text"  lay-verify="required" placeholder="请输入编号" id="usercode" name="usercode" autocomplete="off" class="layui-input">
            </div>
            <div class="layui-form-mid layui-word-aux">编号</div>
            <label class="layui-form-label">用户名</label>
            <div class="layui-input-inline">
                <input type="text"  name="username"  lay-verify="required" placeholder="请输入编号" id="username"   autocomplete="off" class="layui-input">
            </div>
            <div class="layui-form-mid layui-word-aux">用户名</div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">密码框</label>
            <div class="layui-input-inline">
                <input type="password"   lay-verify="required"  name="password"    placeholder="请输入密码" id="password" autocomplete="off" class="layui-input">
            </div>
            <div class="layui-form-mid layui-word-aux">密码</div>
            <label class="layui-form-label">QQ</label>
            <div class="layui-input-inline">
                <input type="text"   placeholder="请输入QQ" id="qq" autocomplete="off" class="layui-input">
            </div>
            <div class="layui-form-mid layui-word-aux">QQ</div>
        </div>
      
        <div class="layui-form-item ">
            <label class="layui-form-label">电话</label>
            <div class="layui-input-inline">
                <input type="text"  placeholder="请输入电话" id="cellphone" autocomplete="off" class="layui-input">
            </div>
            <div class="layui-form-mid layui-word-aux">电话</div>
            <label class="layui-form-label">生日</label>
            <div class="layui-input-inline">
                <input type="text" placeholder="格式:09-19" id="birthdate" autocomplete="off" class="layui-input">
            </div>
            <div class="layui-form-mid layui-word-aux">生日</div>
        </div>
        <div class="layui-form-item ">
            <label class="layui-form-label">邮箱</label>
            <div class="layui-input-inline">
                <input type="text"    placeholder="请输入邮箱" id="email" autocomplete="off" class="layui-input">
            </div>
            <div class="layui-form-mid layui-word-aux">邮箱</div>
            <label class="layui-form-label">身份证号</label>
            <div class="layui-input-inline">
                <input type="text"    placeholder="请输入地址" id="idcard" autocomplete="off" class="layui-input">
            </div>
            <div class="layui-form-mid layui-word-aux">身份证号</div>
        </div>
        <div class="layui-form-item ">
            <label class="layui-form-label">地址</label>
            <div class="layui-input-inline">
                <input    style="width: 539px" placeholder="请输入地址" id="address" autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item layui-form-text">
            <label class="layui-form-label">用户说明</label>
            <div class="layui-input-block">
                <textarea placeholder="请输入内容" id="userremark" style="width: 539px"  class="layui-textarea"></textarea>
            </div>
        </div>
        <div class="layui-form-item layui-form-text">
            <label class="layui-form-label">微信</label>
            <div class="layui-input-inline">
                <input  placeholder="请输入微信" id="wx" class="layui-input"/>
            </div>
        </div>
        <hr class="layui-bg-black">
        <div class="layui-form-item">
            <div class="layui-input-block">
                <button class="layui-btn" lay-submit id="btnSubmit">立即提交</button>
                <button type="reset" class="layui-btn layui-btn-primary">重置</button>
            </div>
        </div>
  
    
    
    

    

    <script src="https://cdn.staticfile.org/jquery/1.10.2/jquery.min.js"></script>
<script src="~/Style/layui/layui.js"></script>
<script>
    layui.config({
        base: '/style/layuiadmin/lib/' //静态资源所在路径
    }).use(['layer', 'form', 'upload', 'laydate','adfCommon'], function () {
        var layer = layui.layer,
            form = layui.form,
            upload = layui.upload,
            laydate = layui.laydate,
            adfCommon = layui.adfCommon;

        laydate.render({
            elem: '#birthdate',
            format: 'MM-dd',
            type:'date'
        });
        var sUrl = "/user/Execute";
        var param = {};
        param.usercode = $("#usercode").val();
        param.username = $("#username").val();
        param.password = $("#password").val();
        param.qq = $("#qq").val();
        param.cellphone = $("#cellphone").val();
        param.birthdate = $("#birthdate").val();
        param.email = $("#email").val();
        param.idcard = $("#idcard").val();
        param.address = $("#address").val();
        param.userremark = $("#userremark").val();
        param.wx = $("#wx").val();
        param.doCmd = "add";


        $("#btnSubmit").click(function () {
            $.ajax({
                url: sUrl,

                data: param,

                type: "POST",
                success: function (retData,index) {
                    if (retData.RetStatus == 101) {
                        close(index);
                        layer.msg('新增成功');
                    } else if (retData.RetStatus != 101) {
                        layer.msg('新增失败');
                    }
                }
            });
        });

    });
</script>
</body>
</html>
